package com.gopay.common.util.xml.utils.validator;

import org.apache.commons.lang3.StringUtils;

import com.gopay.common.util.xml.xmlutils.message.Validator;


public class DefaultCompareToValidator extends BaseValidator {

    @Override
    protected boolean validator(Object validator_, Object value) {
        if (null == value || "".equals(value)) {
            return true;
        }
        Validator validator = (Validator) validator_;
        String compareTo = validator.getCompareTo();

        if (StringUtils.isNotBlank(value.toString()) && StringUtils.equals(compareTo, value.toString())) {
            return true;
        }
        return false;
    }
}
